using System;
using etcetera.Mvc.UI.Grid;

namespace etcetera.Mvc.UI.Toolbar
{
    public interface IPagerToolStrip
    {
        IPagerToolStrip AddToolbar(IToolbar toolbar);

        /// <summary>
        /// Specifies the query string parameter name to use when generating pager links. The default is 'page'
        /// </summary>
        /// <param name="pageQueryStringName">Name of the page query string parameter.</param>
        /// <returns></returns>
        IPagerToolStrip PageQueryStringName(string pageQueryStringName);

        /// <summary>
        /// Specifies the query string parameter name to use when generating pager links. The default is 'pageSize'
        /// </summary>
        /// <param name="pageSizeQueryStringName">Name of the page size query string parameter.</param>
        /// <returns></returns>
        IPagerToolStrip PageSizeQueryStringName(string pageSizeQueryStringName);

        /// <summary>
        /// Specifies the query string parameter name to use when generating pager links. The default is 'sort'
        /// </summary>
        /// <param name="sortQueryStringName">Name of the sort query string parameter.</param>
        /// <returns></returns>
        IPagerToolStrip SortQueryStringName(string sortQueryStringName);

        /// <summary>
        /// Specifies the query string parameter name to use when generating pager links. The default is 'order'
        /// </summary>
        /// <param name="sortOrderQueryStringName">Name of the sort order query string parameter.</param>
        /// <returns></returns>
        IPagerToolStrip SortOrderQueryStringName(string sortOrderQueryStringName);

        /// <summary>
        /// Text or title for the 'first' link/button. The default is 'First'.
        /// </summary>
        /// <param name="first">The text or title for the 'first' link/button.</param>
        /// <returns>The <see cref="PagerToolStrip"/></returns>
        IPagerToolStrip First(string first);

        /// <summary>
        /// Text or title for the 'previous' link/button. The default is 'Previous'.
        /// </summary>
        /// <param name="previous">The text or title for the 'previous' link/button.</param>
        /// <returns>The <see cref="PagerToolStrip"/></returns>
        IPagerToolStrip Previous(string previous);

        /// <summary>
        /// Text or title for the 'next' link/button. The default is 'Next'.
        /// </summary>
        /// <param name="next">The text or title for the 'next' link/button.</param>
        /// <returns>The <see cref="PagerToolStrip"/></returns>
        IPagerToolStrip Next(string next);

        /// <summary>
        /// Text or title for the 'last' link/button. The default is 'Last'.
        /// </summary>
        /// <param name="last">The text or title for the 'last' link/button.</param>
        /// <returns>The <see cref="PagerToolStrip"/></returns>
        IPagerToolStrip Last(string last);

        /// <summary>
        /// Specifies the format to use when rendering a pagination containing multiple pages. 
        /// The default is 'Showing {0} to {1} of {2}' (eg 'Showing 1 to 10 of 16')
        /// </summary>
        IPagerToolStrip Format(string format);

        /// <summary>
        /// Specifies the format to use when rendering a pagination containing a single page. 
        /// The default is 'Showing {0} of {0}' (eg 'Showing 3 of 3')
        /// </summary>
        IPagerToolStrip SinglePageFormat(string format);

        /// <summary>
        /// Sets the elements ID attribute value.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        IPagerToolStrip WithId(string id);

        /// <summary>
        /// Sets the Grid ID.
        /// </summary>
        /// <param name="gridId">The grid id.</param>
        /// <returns></returns>
        IPagerToolStrip WithGridId(string gridId);

        /// <summary>
        /// Sets the AJAX Url.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <returns></returns>
        IPagerToolStrip AjaxUrl(string url);

        IPagerToolStrip ColModel(Action<ColumnModelBuilder> columnBuilder);

        /// <summary>
        /// The grid keeps the size of the page, even when there are less than a page of records on the last page.
        /// </summary>
        /// <returns></returns>
        IPagerToolStrip KeepPageSize();

        /*
        bool HasPreviousPage();
        bool HasNextPage();
        bool UseAjaxUrl();
        */
    }
}